Skip to content

Fix memory usage and chunkcache#18

Merged
UplandJacob merged 60 commits into
TuffNetwork:mainfrom
Trainboy15:main
Jun 14, 2026
Merged

Fix memory usage and chunkcache#18
UplandJacob merged 60 commits into
TuffNetwork:mainfrom
Trainboy15:main

Conversation

@Trainboy15

@Trainboy15 Trainboy15 commented May 18, 2026

Copy link
Copy Markdown
Contributor

IDK if it works put it compiled so...

Also u might want to add back the deploy to testers repo, but i had to remove it

Summary by CodeRabbit

  • New Features

    • CI workflow added to run automated tests on pushes and pull requests.
  • Bug Fixes

    • Plugin now unregisters messaging channels on shutdown and avoids setting null injectors to prevent runtime errors.
    • Improved chunk/block scanning to more reliably detect modern block types and skip additional air variants.
  • Tests

    • New JUnit 5 test suite using a mocked server to verify plugin load, enable, and reload behavior.
  • Chores

    • Test configuration, reporting, and test dependencies updated.

@Trainboy15

Copy link
Copy Markdown
Contributor Author

@UplandJacob If you could test the TuffXPlus-1.0.0-patch that would be great

@bobhenl

bobhenl commented May 18, 2026

Copy link
Copy Markdown
image Still seems to be a bit crazy @Trainboy15

maybe resetting cache more often or not saving so many things to it?
https://spark.lucko.me/JKyN8ssn5p

@Trainboy15

Copy link
Copy Markdown
Contributor Author

I agree, it prob shouldent use 24GB, but it seems at least a bit better than 36GB

@Trainboy15 Trainboy15 marked this pull request as draft May 18, 2026 20:45
@bobhenl

This comment was marked as resolved.

@Trainboy15

This comment was marked as resolved.

@Trainboy15

This comment was marked as resolved.

@Trainboy15

Copy link
Copy Markdown
Contributor Author

@bobhenl If you could test it now that would be great

@bobhenl

bobhenl commented May 19, 2026

Copy link
Copy Markdown

where can be the build downloaded btw, I don't see it in actions

@Trainboy15

Copy link
Copy Markdown
Contributor Author

@coderabbitai

This comment was marked as outdated.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test.yml:
- Around line 15-16: The checkout step currently uses actions/checkout@v4
without disabling token persistence; update the Checkout repository step
(actions/checkout) to set persist-credentials: false so the GitHub token is not
written to local git config during this job. Locate the step that uses
actions/checkout@v4 and add the persist-credentials: false option under that
step's with: block.
- Around line 15-16: Replace floating version tags for GitHub Actions with full
commit SHAs: update each uses: entry (e.g., uses: actions/checkout@v4 and the
other uses: lines flagged at 19 and 33) to reference the corresponding action's
full commit SHA (for example actions/checkout@<full-sha>) by looking up the
canonical commit for the tagged release in the action's GitHub repo and
substituting the tag with that SHA so the workflow is pinned to an immutable
commit.

In `@src/main/java/tf/tuff/TuffX.java`:
- Around line 103-105: TuffX currently only calls
PacketEvents.getAPI().terminate() and unregisters incoming channels via
getServer().getMessenger().unregisterIncomingPluginChannel(this); update
TuffX.shutdown/disable logic to explicitly unregister any plugin channels that
other classes register by calling
getServer().getMessenger().unregisterOutgoingPluginChannel(...) and
getServer().getMessenger().unregisterIncomingPluginChannel(...) for the exact
channel names used in Y0Plugin (the channels registered in Y0Plugin.register...
at the Y0Plugin class) and in TuffActions (the channels registered in
TuffActions at its register calls), ensuring every
registerOutgoing/registerIncoming has a matching unregister to prevent
“registration already exists” on reload.

In `@src/test/TuffXTest.java`:
- Around line 31-65: Tests reference plugin.latestAvailableVersion but TuffX has
no such member, causing compile failures; add a package-visible String field
named latestAvailableVersion to class TuffX (initialize to null) so tests can
read/write it, and update any existing update-check logic (e.g., the method that
detects versions) to assign to this field when an available version is found;
alternatively, expose equivalent package-visible getter/setter on TuffX with the
name latestAvailableVersion so the tests can access the value.
- Around line 1-10: The test class TuffXTest is outside Gradle’s default test
source set; move the file TuffXTest (which declares package tf.tuff) into the
standard test directory so its path matches the package
(src/test/java/tf/tuff/TuffXTest.java) or alternatively update Gradle’s
sourceSets configuration to include its current location; ensure the package
declaration remains tf.tuff and that the class name TuffXTest and imports are
unchanged so JUnit (test { useJUnitPlatform() }) will run it in CI.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d161060d-7acd-4b1c-9979-16b6cd9cd31d

📥 Commits

Reviewing files that changed from the base of the PR and between a20afff and 126fd78.

⛔ Files ignored due to path filters (1)
  • builds/TuffXPlus-1.0.1-beta.jar is excluded by !**/*.jar
📒 Files selected for processing (6)
  • .github/workflows/test.yml
  • build.gradle
  • src/main/java/tf/tuff/TuffX.java
  • src/main/java/tf/tuff/viablocks/CustomBlockListener.java
  • src/main/java/tf/tuff/y0/Y0Plugin.java
  • src/test/TuffXTest.java

Comment thread .github/workflows/test.yml Outdated
Comment thread src/main/java/tf/tuff/TuffX.java
Comment thread src/test/java/tf/tuff/TuffXTest.java
Comment thread src/test/TuffXTest.java Outdated
@TuffNetwork TuffNetwork deleted a comment from coderabbitai Bot Jun 3, 2026
@TuffNetwork TuffNetwork deleted a comment from coderabbitai Bot Jun 3, 2026
@Trainboy15 Trainboy15 marked this pull request as draft June 3, 2026 14:37
@Trainboy15 Trainboy15 marked this pull request as ready for review June 3, 2026 14:38
@Trainboy15

Copy link
Copy Markdown
Contributor Author

So far so good. Just tested the latest version, works great!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
.github/workflows/test.yml (1)

15-16: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add persist-credentials: false to harden credential exposure.

This checkout step does not specify persist-credentials: false, so the GitHub token remains in the local git config throughout the job. Since this workflow only builds, tests, and uploads artifacts without performing any authenticated git operations, persisting credentials is unnecessary and widens the attack surface.

🔒 Proposed fix to disable credential persistence
       - name: Checkout repository
         uses: actions/checkout@v6
+        with:
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test.yml around lines 15 - 16, The checkout step using
actions/checkout@v6 currently leaves the GitHub token in git config; update the
checkout step (the action invocation "actions/checkout@v6") to include the input
persist-credentials: false so credentials are not persisted to the repository
config for the job (add the persist-credentials: false field under the checkout
step).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In @.github/workflows/test.yml:
- Around line 15-16: The checkout step using actions/checkout@v6 currently
leaves the GitHub token in git config; update the checkout step (the action
invocation "actions/checkout@v6") to include the input persist-credentials:
false so credentials are not persisted to the repository config for the job (add
the persist-credentials: false field under the checkout step).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 06827c60-2536-43d5-87dd-7d6ed070259d

📥 Commits

Reviewing files that changed from the base of the PR and between 2f3586c and c5c1873.

📒 Files selected for processing (1)
  • .github/workflows/test.yml

UplandJacob
UplandJacob previously approved these changes Jun 14, 2026
UplandJacob
UplandJacob previously approved these changes Jun 14, 2026
Comment thread .github/workflows/test.yml Fixed
@UplandJacob UplandJacob merged commit fa10f43 into TuffNetwork:main Jun 14, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants